<?php

namespace App\HttpController\Admin;

use App\Logic\Member\MemberService;
use App\Logic\Order\OrderService;

/**
 * @ApiGroup(groupName="会员管理")

 */
class Member extends BaseController{

    public function index()
    {
        $result = MemberService::getInstance()->getLists($this->request());
        return $this->writeJsonByOutput($result);

    }

    public function setState(){
        $service = new MemberService();
        $data = $this->getJson();
        $result = $service->settingState($data);
        return $this->writeJsonByOutput($result);
    }
    public function dict(){
        $service = new MemberService();
        $result = $service->getDict($this->request());
        return $this->writeJsonByOutput($result);
    }
    public function setProfit(){
        $service = new MemberService();
        $data = $this->getJson();
        $result = $service->setProfit($data);
        return $this->writeJsonByOutput($result);
    }
    public function setLockedDay(){
        $service = new MemberService();
        $data = $this->getJson();
        $result = $service->setlockedDay($data);
        return $this->writeJsonByOutput($result);
    }

    public function setPassword(){
        $service = new MemberService();
        $data = $this->getJson();
        $data['password'] = mt_rand(1000000000,9999999999);
        $result = $service->setPassword($data);
        return $this->writeJsonByOutput($result);
    }

}
